home *** CD-ROM | disk | FTP | other *** search
/ Amiga Inside! / Amiga FD Inside (1995)(Ultramax).iso / berndspd / disktools / boottool / bbsources / clipatchbb_1.1.asm next >
Encoding:
Assembly Source File  |  1994-04-26  |  4.1 KB  |  198 lines

  1.  
  2. ; Assembler: DevPac 2.14
  3.  
  4. ; use Tab 11
  5.  
  6.  
  7. TAG_USER        equ    $80000000
  8. TAG_DONE        equ    0
  9. WA_Left        equ    TAG_USER+100
  10. WA_Top        equ    TAG_USER+101
  11. WA_Width        equ    TAG_USER+102
  12. WA_Height        equ    TAG_USER+103
  13. WA_Flags        equ    TAG_USER+107
  14. WA_Title        equ    TAG_USER+110
  15. WA_ScreenTitle    equ    TAG_USER+111
  16. WA_MinWidth    equ    TAG_USER+114
  17. WA_MinHeight    equ    TAG_USER+115
  18. WA_MaxWidth    equ    TAG_USER+116
  19. WA_MaxHeight    equ    TAG_USER+117
  20.  
  21.     opt    o+,p+
  22.  
  23. *****  CLIPatch--Bootblock V1.1  *****
  24.  
  25. bootcode    dc.l    $444f5300        ; DOS-Disk OFS
  26.     dc.l    $00000000        ; CheckSum
  27.     dc.l    $00000370        ; RootBlock pointer
  28.  
  29. ; -----  Standart-DOS-Bootcode
  30.     
  31. .dos_boot    lea    exp_lib(pc),a1    ; Standard OS2.0 code
  32.     moveq    #37,d0
  33.     jsr    -552(a6)        ; _LVOOpenLibrary
  34.     tst.l    d0
  35.     beq.s    .no_explib
  36.     move.l    d0,a1
  37.     bset    #6,34(a1)
  38.     jsr    -414(a6)        ; _LVOCloseLibrary
  39. .no_explib    lea    dos_lib(pc),a1
  40.     jsr    -96(a6)        ; _LVOFindResident
  41.     tst.l    d0
  42.     beq.s    .not_found
  43.     move.l    d0,a0
  44.     movea.l    22(a0),a0
  45.     moveq    #0,d0
  46.     bra.s    .own_boot
  47. .not_found    moveq    #-1,d0    
  48.  
  49. ; -----  KS-Version testen und entsprechenden Patch installieren
  50.     
  51. .own_boot    movem.l    d0-d7/a0-a6,-(sp)
  52.     cmp.w    #37,$14(a6)    ; eb_SoftVer
  53.     blt.s    dos_13
  54.  
  55. ; -----  OpenWindowTagList-Patch installieren (KS 2.0)
  56.  
  57. dos_20    move.l    #openwd_20_end-openwd_20,d0
  58.     move.l    #$10000,d1
  59.     jsr    -198(a6)        ; _LVOAllocMem
  60.     tst.l    d0
  61.     beq.s    .no_mem
  62.     move.l    d0,a5
  63.     lea    int_lib(pc),a1
  64.     moveq    #37,d0
  65.     jsr    -552(a6)        ; _LVOOpenLibrary
  66.     move.l    d0,a1
  67.     lea    oldopen_20(pc),a0
  68.     move.l    -606+2(a1),(a0)    ; alte Adresse sichern
  69.     move.l    a5,-606+2(a1)    ; und eigene eintragen
  70.     lea    openwd_20(pc),a0
  71.     move.l    #openwd_20_end-openwd_20-1,d0
  72. .loop    move.b    (a0)+,(a5)+    ; Code copieren
  73.     dbra    d0,.loop
  74. .no_mem    movem.l    (sp)+,d0-d7/a0-a6
  75.     rts
  76.  
  77. ; -----  OpenWindow-Patch installieren (KS 1.3)
  78.  
  79. dos_13    move.l    #openwd_13_end-openwd_13,d0
  80.     move.l    #$10000,d1
  81.     jsr    -198(a6)        ; _LVOAllocMem
  82.     tst.l    d0
  83.     beq.s    .no_mem
  84.     move.l    d0,a5
  85.     lea    int_lib(pc),a1
  86.     moveq    #33,d0
  87.     jsr    -552(a6)        ; _LVOOpenLibrary
  88.     move.l    d0,a1
  89.     lea    oldopen_13(pc),a0
  90.     move.l    -204+2(a1),(a0)    ; alte Adresse sichern
  91.     move.l    a5,-204+2(a1)    ; und eigene eintragen
  92.     lea    openwd_13(pc),a0
  93.     move.l    #openwd_13_end-openwd_13-1,d0
  94. .loop    move.b    (a0)+,(a5)+    ; Code copieren
  95.     dbra    d0,.loop
  96. .no_mem    movem.l    (sp)+,d0-d7/a0-a6
  97.     rts
  98.  
  99. ; -----  der OpenWindow-Patch
  100.     
  101. openwd_13    move.w    le_13(pc),(a0)    ; Daten in NewWindow-Struktur
  102.     move.w    te_13(pc),2(a0)    ; eintragen
  103.     move.w    width_13(pc),4(a0)
  104.     move.w    height_13(pc),6(a0)
  105.     move.l    flags_13(pc),$0e(a0)
  106.     move.l    #0,$1a(a0)
  107.     move.w    nwidth_13(pc),$26(a0)
  108.     move.w    nheight_13(pc),$28(a0)
  109.     move.w    xwidth_13(pc),$2a(a0)
  110.     move.w    xheight_13(pc),$2c(a0)
  111.     move.l    oldopen_13(pc),-204+2(a6)
  112.     jsr    -204(a6)        ; _LVOOpenWindow
  113.     movem.l    d0/a0/a1/a2/a6,-(sp)
  114.     move.l    d0,a0
  115.     lea    wdtitle_13(pc),a1
  116.     lea    sctitle_13(pc),a2
  117.     jsr    -276(a6)        ; _LVOSetWindowTitles
  118.     movem.l    (sp)+,d0/a0/a1/a2/a6
  119.     rts
  120.     
  121. oldopen_13    dc.l    0
  122.  
  123. le_13    dc.w    0
  124. te_13    dc.w    0
  125. width_13    dc.w    640
  126. height_13    dc.w    256
  127. flags_13    dc.l    1+2+4+16+4096    ; glaub` ich
  128. nwidth_13    dc.w    80
  129. nheight_13    dc.w    64
  130. xwidth_13    dc.w    -1
  131. xheight_13    dc.w    -1
  132. wdtitle_13    dc.b    "AmigaDOS",0,0
  133.     dc.l    0,0,0,0,0,0,0,0,0,0
  134. sctitle_13    dc.b    "Workbench Screen",0,0,0,0
  135.     dc.l    0,0,0,0,0
  136.  
  137. openwd_13_end
  138.  
  139. ; -----  der OpenWindowTagList-Patch
  140.  
  141. openwd_20    movem.l    d0/d1/a2/a3,-(sp)
  142.     move.l    a1,a2
  143.     lea    my_tags(pc),a3
  144.     move.l    (a3)+,d1
  145. .tag_loop    move.l    (a2)+,d0
  146.     tst.l    d0
  147.     beq.s    .all_done
  148.     cmp.l    d0,d1
  149.     beq.s    .tag_found
  150.     adda.l    #4,a2
  151.     bra.s    .tag_loop
  152. .tag_found    move.l    (a3)+,(a2)+
  153.     move.l    a1,a2
  154.     move.l    (a3)+,d1
  155.     tst.l    d1
  156.     bne.s    .tag_loop
  157. .all_done    movem.l    (sp)+,d0/d1/a2/a3
  158.     move.l    oldopen_20(pc),-606+2(a6)
  159.     jsr    -606(a6)        ; _LVOOpenWindowTagList
  160.     movem.l    d0/a0/a1/a2/a6,-(sp)
  161.     move.l    d0,a0
  162.     lea    wdtitle_20(pc),a1
  163.     lea    sctitle_20(pc),a2
  164.     jsr    -276(a6)        ; _LVOSetWindowTitles
  165.     movem.l    (sp)+,d0/a0/a1/a2/a6
  166.     rts
  167.  
  168. oldopen_20    dc.l    0
  169.  
  170. my_tags    dc.l    WA_Left,0
  171.     dc.l    WA_Top,0
  172.     dc.l    WA_Width,640
  173.     dc.l    WA_Height,256
  174.     dc.l    WA_Flags,1+2+4+16+4069
  175.     dc.l    WA_MinWidth,80
  176.     dc.l    WA_MinHeight,64
  177.     dc.l    WA_MaxWidth,-1
  178.     dc.l    WA_MaxHeight,-1
  179.     dc.l    TAG_DONE
  180.  
  181. wdtitle_20    dc.b    "AmigaDOS",0,0
  182.     dc.l    0,0,0,0,0,0,0,0,0,0
  183. sctitle_20    dc.b    "Workbench Screen",0,0,0,0
  184.     dc.l    0,0,0,0,0
  185.  
  186. openwd_20_end
  187.  
  188. ; -----  Konstanten, Variablen
  189.  
  190. exp_lib    dc.b    "expansion.library",0
  191. dos_lib    dc.b    "dos.library",0
  192. int_lib    dc.b    "intuition.library",0
  193.  
  194. bootcode_end
  195.  
  196.     end
  197.  
  198.